package com.qing.design.patterns.builder.example.builders;

import com.qing.design.patterns.builder.example.cars.Car;
import com.qing.design.patterns.builder.example.cars.CarType;
import com.qing.design.patterns.builder.example.cars.Manual;
import com.qing.design.patterns.builder.example.components.Engine;
import com.qing.design.patterns.builder.example.components.GPSNavigator;
import com.qing.design.patterns.builder.example.components.Transmission;
import com.qing.design.patterns.builder.example.components.TripComputer;

/**
 *与其他创造模式不同，建设者可以构建不相关的产品，
 *它们没有公共接口。
 *
 *在本例中，我们为汽车构建了一个用户手册，使用与我们相同的步骤
 *造了辆车。这样就可以为特定车型制作手册，
 *配置了不同的功能。
 *
 * 汽车手册
 */
public class CarManualBuilder implements Builder {


	//汽车类型
	private CarType carType;
	//座位
	private   int seats;
	//发动机
	private Engine engine;
	//变速箱
	private Transmission transmission;
	//车载电脑
	private TripComputer tripComputer;
	//GPS 导航
	private GPSNavigator gpsNavigator;

	public void setCarType(CarType carType) {
		this.carType = carType;
	}

	public void setSeats(int seats) {
		this.seats = seats;
	}

	public void setEngine(Engine engine) {
		this.engine = engine;
	}

	public void setTransmission(Transmission transmission) {
		this.transmission = transmission;
	}

	public void setTripComputer(TripComputer tripComputer) {
		this.tripComputer = tripComputer;
	}

	public void setGpsNavigator(GPSNavigator gpsNavigator) {
		this.gpsNavigator = gpsNavigator;
	}

	public Manual getResult(){
		return new Manual(carType,seats,engine,transmission,tripComputer,gpsNavigator);
	}

}
